Conditional count
Hi,
I'm developing a Report and I have problems to obtain some "count" values. This is a example of the data:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
Account Result
AccountA X
AccountB Y
AccountC Z
AccountD X
AccountE Y
--
Results:
X 2
Y 2
Z 1
<!--fontc--></span><!--/fontc-->
I can't obtain this Results, I don't know how to do this count. I know about the expressions (count, sum, avg), but my problem is that I cannot use a Group Header with Result, because this data are in another GroupHeader (By Account). I'm grouping by Account and choose the first registry. So group by Result isn't possible because I can't choose the first registry by account.
How can I to do this?
Thanks in advance and sorry by my english.
I'm developing a Report and I have problems to obtain some "count" values. This is a example of the data:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
Account Result
AccountA X
AccountB Y
AccountC Z
AccountD X
AccountE Y
--
Results:
X 2
Y 2
Z 1
<!--fontc--></span><!--/fontc-->
I can't obtain this Results, I don't know how to do this count. I know about the expressions (count, sum, avg), but my problem is that I cannot use a Group Header with Result, because this data are in another GroupHeader (By Account). I'm grouping by Account and choose the first registry. So group by Result isn't possible because I can't choose the first registry by account.
How can I to do this?
Thanks in advance and sorry by my english.
Comments
Attache here en example of your query (I mean a select statement) that you use to get AccountA, AccountB, AccountC, ... . I'll try to find a solution how to put a specific count below. My idea is to create another query which shoud be used for a subreport on a band that you need it.
It would be fine if you could build this example query using FR 4 demo database and one of its tables.
Mick
Anyone who visit this forum knows Fast Report technology - from newbies to experts. In my opinion there are three groups of people coming here: programists, developers (but they are almost like the first ones) and end users who have been received an application using FastReport designer. Which of these groups you belong to?
The main problem of people writing here and searching for solution is: how to describe my problem and NOT to tell TOO MUCH about what I'm really doing. Have a look through several posts and you will see how many times FR Team or other members do ask for more details to be able to understand what is the root of the problem. And so often they have NO answer - seems like those who ask for help are happy just to write about the problem and then they forget to have a look back here [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Both Gpi and I don't say about anything more than you can find in FastReport documentation. Query is TfrxADOQuery, subreport is a component you can lay down on a band. So please specify more details about your problem, attach an example of your main query (TfrxADOQuery, TfrxDataSet). And keep hoping someone here will try to help you find a solution[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Mick[/img]